package cn.sinata.wanglin.mine.activity;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.xilada.xldutils.activitys.BaseActivity;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.sinata.wanglin.R;
import cn.sinata.wanglin.adapter.VillageActivePagerAdapter;
public class VillageActiveActivity extends BaseActivity {
    @BindView(R.id.viewpager)
    ViewPager viewpager;//
    @BindView(R.id.tabs)
    TabLayout tabs;//
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_village_active);
        ButterKnife.bind(this);
        setupViewPager();
    }

    private void setupViewPager() {
        List<String> titles = new ArrayList<>();
        titles.add("我发布的");
        titles.add("我参与的");
        VillageActivePagerAdapter adapter = new VillageActivePagerAdapter(getSupportFragmentManager(), titles);
        viewpager.setOffscreenPageLimit(2);
        viewpager.setAdapter(adapter);
        tabs.setupWithViewPager(viewpager);
    }

    @OnClick({R.id.iv_finish})
    void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_finish:
                //描述:
                finish();
                break;
        }
    }
}
